package com.farmpost.server.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.farmpost.server.pojo.Followed;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author king
 * @since 2022-04-12
 */
public interface FollowedMapper extends BaseMapper<Followed> {


    /**
     * 取消关注
     * @param followedUserId
     * @param status
     * @return
     */
    int updateStatus(@Param("followedUserId") Integer followedUserId, @Param("status") int status);

    /**
     * 更改关注者id
     * @param followedUserId
     * @param userId
     * @param updateTime
     * @return
     */
    int updateFollowedUserId(@Param("followedUserId") Integer followedUserId, @Param("userId") Integer userId, LocalDateTime updateTime);

    /**
     * 更改关注者状态
     * @param status
     * @param userId
     * @param updateTime
     * @return
     */
    int updateFollowedStatus(@Param("status") Integer status, @Param("userId") Integer userId, LocalDateTime updateTime);

    int updateFollowed(@Param("followedUserId") Integer followedUserId, @Param("status") Integer status, @Param("userId") Integer userId, @Param("updateTime") LocalDateTime updateTime);
}
